package com.maybach.core.ao;

import com.maybach.common.BizResult;
import com.maybach.common.model.LoanOrderDO;
import com.maybach.core.form.finance.FinanceDetailForm;
import com.maybach.core.form.order.*;
import com.maybach.dubbo.api.model.*;
import com.maybach.core.form.order.QueryPartnerForm;
import com.maybach.dubbo.api.query.LoanOrderQueryModel;
import com.maybach.util.query.support.PageResult;

import javax.servlet.http.HttpServletResponse;

/**
 * Created by houenxun on 16/2/23.
 */
public interface LoanOrderAO {
    /**
     * 新增订单宝
     * @param addLoanOrderForm
     */
    void  addLoanOrder(AddLoanOrderForm addLoanOrderForm);

    /**
     * 新增订单宝
     * @param model
     */
    com.maybach.dubbo.api.BizResult<LoanOrderCreateResultModel> addLoanOrder(CreateLoanOrderModel model);

    /**
     * 查询订单宝信息
     * @param queryLoanOrderForm
     * @return
     */
    BizResult queryLoanOrders(QueryLoanOrderForm queryLoanOrderForm);

    /**
     * 导出订单宝信息
     * @param exportLoanOrderForm
     */
    void exportLoanOrders(ExportLoanOrderForm exportLoanOrderForm);

    /**
     * 获取订单宝信息
     * @param id
     * @return
     */
    BizResult queryLoanOrderById(Long id);
    LoanOrderDO queryLoanOrderByOutOrderId(Long outOrderId);
    LoanOrderDO queryById(Long id);

    /**
     * 获取订单宝信息(订单宝编辑之前的信息)
     * @param id
     * @return
     */
    BizResult queryEditLoanOrderById(Long id);

    /**
     * 获取供应商信息
     * @param queryPartnerForm
     * @return
     */
    BizResult queryPartnerList(QueryPartnerForm queryPartnerForm);

    /**
     * 供应商编辑页面
     * @param id
     * @return
     */
    BizResult editLoanOrderProviderView(Long id);

    /**
     * 编辑订单宝供应商信息
     * @param editLoanOrderPartnerForm
     * @return
     */
    BizResult editLoanOrderProvider(EditLoanOrderPartnerForm editLoanOrderPartnerForm);

    /**
     * 审核页面需求数据
     * @param approveLoanOrderForm
     * @return
     */
    BizResult approveImgsView(ApproveLoanOrderForm approveLoanOrderForm);

    /**
     *
     * @param approveLoanOrderForm
     * @return
     */
    BizResult approveLoanOrderImgs(ApproveLoanOrderForm approveLoanOrderForm);

    /*
     * 编辑订单宝
     * @param editLoanOrderForm
     */
    void  editLoanOrder(EditLoanOrderForm editLoanOrderForm);
    void  editLoanOrderFinanceDetail(FinanceDetailForm financeDetailForm);



    /**
     * 关闭订单宝
     */
    com.maybach.dubbo.api.BizResult<Void> closeLoanOrder(Long orderId);

    /**
     * 查询订单宝
     * @param loanOrderId
     * @return
     */
    com.maybach.dubbo.api.BizResult<LoanOrderDetailModel> queryOrderDetail(Long loanOrderId);

    /**
     * 分业查询订单宝
     * @param query
     * @return
     */
    PageResult<LoanOrderModel> queryLoanOrder(LoanOrderQueryModel query);

    /**
     * 提交完善资料
     * @param model
     * @return
     */
    com.maybach.dubbo.api.BizResult<Void> submitOrderInfo(OrderInfoModel model);

    /**
     * 关闭订单宝
     * @param closeLoanOrderForm
     * @return
     */
    BizResult closeLoanOrder(CloseLoanOrderForm closeLoanOrderForm);

    /**
     * 删除订单宝
     * @param closeLoanOrderForm
     * @return
     */
    BizResult deleteLoanOrder(CloseLoanOrderForm closeLoanOrderForm);

    /*
     * 统计订单数量
     * @param buyerId
     * @param status
     * @return
     */
    com.maybach.dubbo.api.BizResult<Integer> countOrder(Long buyerId, Integer status);

    /**
     * 查询订单宝操作日志
     * @param actLogForm
     * @return
     */
    BizResult queryLoanOrderActLogs(QueryLoanOrderActLogForm actLogForm);

    /**
     * 获取请款单信息
     * @param id
     * @return
     */
    BizResult getContractInfo(Long id);

    /**
     * 获取委托函的信息
     * @param id
     * @return
     */
    BizResult getLetterInfo(Long id);

    BizResult createContractPDF(String path, Long id, HttpServletResponse response);

    /**
     * 生成线上合同(获取合同数据)
     * @param id
     * @return
     */
    BizResult createContract(Long id);

    BizResult checkSendLetter(Long id);
}
